<div class="form">
	<?php
	$form = $this->beginWidget('PsActiveForm', array(
		'id' => 'add-team-form',
		'enableAjaxValidation' => false,
		'htmlOptions' => array(
			'class' => 'form'
		)
	));
	?>
    <div class="table-block">
        <table class="form-table">
            <tr>
                <th scope="row" width="80">
					<?php echo $form->labelEx($agencyTeam, 'name', array('label' => 'Team Name')); ?>
                </th>
                <td>
                    <div class="form-table-block">
						<?php echo $form->textField($agencyTeam, 'name'); ?>
						<?php echo $form->error($agencyTeam, 'name'); ?>
                    </div>
                </td>
			</tr>
			<?php if (Yii::app()->user->hasMultipleAgenciesSelected()): ?>
				<tr>
					<th scope="row" width="80">
						<?php echo $form->labelEx($agencyTeam, 'agency_id'); ?>
					</th>
					<td>
						<?php
						$this->widget('common.widgets.PsSelect2.PsSelect2', array(
							'model' => $agencyTeam,
							'attribute' => 'agency_id',
							'data' => GxHtml::listDataEx(Yii::app()->user->model->agency->getChildAgencies()),
							'htmlOptions' => array(
								'prompt' => 'Select Agency',
								'multiple' => false,
								'style' => 'width:250px;',
							)
						));
						?>
						<?php echo $form->error($agencyTeam, 'agency_id'); ?>
					</td>
				</tr>
			<?php endif; ?>
        </table>
		<?php echo GxHtml::submitButton('Save', array('name' => 'submit', 'class' => 'green no-margin')); ?>
    </div>
	<?php $this->endWidget(); ?>
</div>